﻿using DBA.DataBaseAccess;

namespace BL.ServerBL
{
    partial class ServerRemotingCommon : BL.UAClientRemotingInterface.IUserAuthority
    {
        #region UserIndentify
        public bool UserIndentify(string user_name, string user_password)
        {
            bool bl = DBAccess.UserIndentify(user_name.Trim(), user_password.Trim());
            return bl;
        }

        public bool FUserIndentify(string user_name, string user_password)
        {
            string user_type_id = "0";
            bool bl = this.UserIndentify(user_name, user_password, user_type_id);
            return bl;
        }

        public bool UserIndentify(string user_name, string user_password, string user_type_id)
        {
            bool bl = DBAccess.UserIndentify(user_name, user_password, user_type_id);
            return bl;
        }

        public string GetUserIdBySN(string department_sn, string user_password)
        {
            return DBAccess.GetUserIdBySN(department_sn, user_password);
        }

        public bool UserIndentifyBySN(string department_sn, string user_password)
        {
            return DBAccess.UserIndentifyBySN(department_sn, user_password);
        }

        public string GetUserIdBySNRealName(string department_sn, string user_realname)
        {
            return DBAccess.GetUserIdBySNRealName(department_sn, user_realname);
        }
        public bool UserIndentifyByDeptRealName(string department_sn, string user_realname)
        {
            return DBAccess.UserIndentifyByDeptRealName(department_sn, user_realname);
        }
        public string GetUserId(string user_name)
        {
            return DBAccess.GetUserIdByUserName(user_name);
        }
        public string GetUserName(string user_id)
        {
            return DBAccess.GetUserNameByUserId(user_id);
        }
        public string GetUserRealName(string user_id)
        {
            return DBAccess.GetUserRealNameByUserId(user_id);

        }
        public string GetDepartmentId(string user_id)
        {
            return DBAccess.GetDepartmentIdByUserId(user_id);
        }
        public string GetDepartmentName(string user_id)
        {
            return DBAccess.GetDepartmentNameByUserId(user_id);
        }

        public string GetDepartmentPName(string user_id)
        {
            return DBAccess.GetDepartmentPNameByUserId(user_id);
        }
        public void RaiseUserLogin(string user_name, string user_ip, string user_hostname)
        {
            UserState.RaiseUserLogin(user_name, user_ip, user_hostname);
        }

        public void RaiseUserLogout(string user_hostname)
        {
            UserState.RaiseUserLogout(user_hostname);
        }
        #endregion
    }
}
